# -*- encoding: utf-8 -*-
"""
@File    : yield_use.py
@Author  : lilong
@Time    : 2022/5/3 6:28 下午
"""

"""
参考：https://www.jianshu.com/p/9dd355ab4e5d
"""


def addlist(alist):
    for i in alist:
        yield i + 1


alist = [1, 2, 3, 4]
for x in addlist(alist):
    print(x)

print(alist)
